package com.ncloud.common.body;

import com.ncloud.common.enmus.ResultEnum;

/**
 * Created by shiqiang on 2017/6/23.
 */
public class Result<T> {
    /*错误码*/
    private Integer code;
    /*错误消息*/
    private String msg;
    /*body实体内容*/
    private T data;

    public Result() {

    }

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public Result(ResultEnum resultEnum) {
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMessage();
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
